package com.gitee.sidihuo.platform.base;

import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;

import java.util.concurrent.LinkedBlockingQueue;

@Slf4j
public class BaseProducer {

    public static LinkedBlockingQueue<Object> queues = new LinkedBlockingQueue<>(10000);

    public static boolean produce(Object o) {
        boolean offer = queues.offer(o);
        if (!offer) {
            log.warn("producer-consumer produce failed {}", JSONObject.toJSONString(o));
        }
        return offer;
    }

}
